Skip to content

Add weekly workflow to create issue when monitored spack-packages change#171

Merged
adrienbernede merged 13 commits into
mainfrom
copilot/issue-170-spack-packages-references
Jun 2, 2026
Merged

Add weekly workflow to create issue when monitored spack-packages change#171
adrienbernede merged 13 commits into
mainfrom
copilot/issue-170-spack-packages-references

Conversation

Copilot AI commented May 26, 2026

Copy link
Copy Markdown
Contributor

Replaces #170

Add .github/workflows/track-spack-packages.yml, a scheduled workflow that
watches spack/spack-packages for changes since the commit pinned in selected
envs and opens an issue per affected env.

  • Trigger: single weekly cron ('17 6 * * 1', Mondays 06:17 UTC) plus
    workflow_dispatch with a target input (all / shared-ci / cached-cmake)
  • Matrix entries declare packages: (list of package names) and/or files:
    (specific upstream paths) directly. One row per tracked env; the rest of the
    workflow has no per-env branching.
  • Current coverage:
    • shared-ci: camp, umpire, raja, raja-perf, chai, care, caliper, against
      .gitlab/spack/envs/shared-ci/spack.yaml
    • cached-cmake: repos/spack_repo/builtin/build_systems/cached_cmake.py,
      against .gitlab/spack/envs/cached-cmake/spack.yaml
  • Detection (single code path): resolve packages to
    repos/spack_repo/builtin/packages/<name_with_underscores>, union with the
    literal files list, git diff --name-only from the pinned commit to the tip
    of the upstream default branch, then capture a scoped diff for whichever
    watched paths actually changed.
  • Commit pin read via yq '.spack.repos.builtin.commit' with explicit null
    and 40-char SHA-1 format checks (no more grepping any commit: line).
  • Issue: title [<entry>] Update spack-packages reference to <short-sha>,
    labels dependencies and automation. Body includes a current/new commit
    table, the changed paths, and a fenced diff truncated at 60000 chars to stay
    under the 65536-char issue body cap.
  • Force-push / orphaned-pin edge case: still files an issue with placeholders
    explaining the diff could not be computed.
  • Permissions: contents: read, issues: write; uses ${{ github.token }}
    with gh issue create.

Out of scope: the original draft also tracked toss_4_x86_64_ib,
toss_4_x86_64_ib_cray, and blueos_3_ppc64le_ib, plus a cross-file commit
consistency check. Both were dropped when the workflow moved to one matrix
entry per tracked env; if pins diverge between envs in the future, each entry
reports independently.

TODO:
- [ ] Wait for a change in one of the tracked packages to demo issue creation.

  • Test issue creation adding a package that has changes
  • Remove pull_request trigger

See created issue (closed because for testing only): #172

…make paths

Agent-Logs-Url: https://github.com/llnl/radiuss-spack-configs/sessions/1254137a-1378-46fe-b15c-5e72120a523e

Co-authored-by: adrienbernede <51493078+adrienbernede@users.noreply.github.com>
…puts

  Each matrix entry now declares `packages:` and/or `files:` directly, and a
  single detection path resolves both to upstream paths and diffs the pinned
  range against them. This removes the `track_type` discriminator and the
  parallel packages-vs-build_system branches in the detect and issue steps,
  and removes the awk-based extraction of the package list from the env yaml.

  Other changes folded in:
  - Read the spack-packages commit pin via `yq '.spack.repos.builtin.commit'`
    instead of grepping any `commit:` line, with explicit null-and-format checks.
  - Move the schedule from daily to a single weekly run (Mondays 06:17 UTC) and
    drop the per-matrix cron entries; workflow_dispatch keeps a `target` input
    to run a single entry on demand.
  - Rename intermediate files to `WATCHED_PATHS_FILE`, `CHANGED_PATHS_FILE`,
    `DIFF_FILE` for symmetry.

  Assisted by Claude Code
@adrienbernede adrienbernede marked this pull request as ready for review May 28, 2026 15:10
@adrienbernede adrienbernede changed the title Add daily workflow to create issue when monitored spack-packages change Add weekly workflow to create issue when monitored spack-packages change May 29, 2026
@adrienbernede adrienbernede added the automation created by an automated process label Jun 1, 2026

@tdrwenski tdrwenski left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, I think it looks good! 🎉

name: Track spack-packages updates

on:
pull_request:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this was for testing, change to workflow_dispatch?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, exactly, let me add it to the TODOs so I don't forget to remove it after the reviews are done.

echo "should_update=true" >> "${GITHUB_OUTPUT}"
echo "reason=relevant_changes_found" >> "${GITHUB_OUTPUT}"

- name: Create issue

@tdrwenski tdrwenski Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how much work it would add but it might be nice to check if there is already an open PR for the needed update to avoid duplicate PRs if you don't merge right away... can always try it out and add this later though.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is opening an issue, not a PR. I just need to mention the issue in the existing PR with appropriate keyword (e.g. fixes #<issue>) if I want the PR to close the issue automatically on merge.

@adrienbernede adrienbernede Jun 1, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I answered your comment.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh yes, sorry, I should have said maybe it can check if there is an open issue before it creates a new issue to avoid duplicate issues-- Say you are gone for 3 weeks, won't it once a week make a new issue to update the commit? It is not a big problem, we can also see how it goes first.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed any new issue could replace the previous one: if the older issue is not closed, the newer one covers both the previous and potentially new changes... I’ll open an issue to treat that in a subsequent PR.

@adrienbernede adrienbernede merged commit b90d59b into main Jun 2, 2026
7 checks passed
adrienbernede added a commit that referenced this pull request Jun 2, 2026
@adrienbernede adrienbernede deleted the copilot/issue-170-spack-packages-references branch June 4, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation created by an automated process

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants